package com.qfedu.edu.iotserver.controller;


import com.qfedu.edu.dto.PageDto;
import com.qfedu.edu.iotserver.service.AreaService;
import com.qfedu.edu.pojo.Area;
import com.qfedu.edu.result.PageResult;
import com.qfedu.edu.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 行政区划表 前端控制器
 * </p>
 *
 * @author xiaobobo
 * @since 2024-09-13
 */
@RestController
@RequestMapping("/iotserver/area")
@Api(description = "区域模块",tags = "区域模块")
public class AreaController {

    @Autowired
    private AreaService areaService;

    @GetMapping("/getAreaList")
    @ApiOperation(value = "获取行政区划列表")
    @ApiImplicitParam(name = "token" ,value = "用户令牌" ,required = true,dataType = "String",paramType = "header")
    public R getAreaList(PageDto pageDto,String name,String code){
        PageResult<Area> pageResult = areaService.getAreaList(pageDto,name,code);
        return R.ok().data("pageResult", pageResult);
    }
}

